package com.xbongbong.workflow.pojo.nodes;

import com.xbongbong.workflow.enums.WorkflowConditionOperatorEnum;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.Valid;
import javax.validation.constraints.Size;
import java.util.ArrayList;
import java.util.List;

/**
 * 工作流条件节点 且或联合节点
 * @author 魏荣杰
 *
 */
@Setter
@Getter
@ToString
public class WorkflowJointConditionPojo {

    /**
     * 条件组
     */
    @Valid
    @Size(max = 3, message = "{dto.msg.conditionNode.conditions.Size.max}")
    private List<WorkflowConditionFilters> filters;

    /**
     * 且或 标记
     * @see com.xbongbong.workflow.enums.WorkflowConditionOperatorEnum
     */
    private String operator;

    public WorkflowJointConditionPojo() {
        filters = new ArrayList<>();
        operator = WorkflowConditionOperatorEnum.OR.getAlias();
    }
}
